# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=usbguard-notifier
pkgver=0.1.1
pkgrel=0
pkgdesc="Notifies on USBGuard policy and device presence changes"
url="https://github.com/Cropi/usbguard-notifier"
license="GPL-2.0-or-later"
# loongarch64: blocked by usbguard
arch="all !loongarch64"
makedepends="
	autoconf
	automake
	libtool
	usbguard-dev
	librsvg-dev
	libnotify-dev
	catch2
	asciidoc
	"
subpackages="$pkgname-doc"
source="https://github.com/Cropi/usbguard-notifier/archive/usbguard-notifier-$pkgver.tar.gz
	no-systemd.patch"
builddir="$srcdir/$pkgname-$pkgname-$pkgver"

prepare() {
	default_prepare
	sed -i "s#/usr/include/catch#/usr/include/catch2#g" configure.ac
	autoreconf -fiv
}

check() {
	make check
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	make install DESTDIR="$pkgdir"
}

sha512sums="
27c6fc652b08ba05d8c8de92d73a12ec3543d990d1260c4f44693ac8aed225eeceef6891cb338cee3e81bfbb2060bdfaf3aff38e8203410aa8b0455ee4d26166  usbguard-notifier-0.1.1.tar.gz
09ca4890884d0a62d1b152c6cc5120c9856f46b778cba6f3d36a831ad6f0e5e6651e4e5532e8cefbc55583b862af4c649e6299591fed66b4c9187f7e4f363f85  no-systemd.patch
"
